import styles from '../index.less';
import React, { useState, useEffect, memo } from 'react';
import kls from 'classnames';
import Chart3 from './chart3';
import Chart2 from './chart2';
import Chart1 from './chart1';
// import { useStatisticsData, updateStatisticsData } from '../index';
import { useSelector } from 'umi';

const Left = () => {
  const curProjId = useSelector(store => store.app.curProjId);
  const searchStr = `?projectId=${curProjId}`;
  // const [curData, setCurData] = useStatisticsData();
  // useEffect(() => {
  //   curProjId && updateStatisticsData(setCurData, curProjId);
  // }, [curProjId]);

  // console.log(curData);
  return (
    <div className={kls(styles.qualityAndSafetyL)}>
      <div className="side-panel2" style={{ top: 144, left: 24 }}>
        <div className="side-panel2-title flex-spb">质量安全</div>
        <div className={kls('side-panel2-body', styles.autoHeightPanel)}>
          <div
            className="side-panel2-subtitle"
            style={{ paddingLeft: 16, paddingTop: 24, paddingBottom: 16 }}
          >
            <a
              href={'http://wccg.tech:82/#/quality/newAccept' + searchStr}
              target="_blank"
              rel="noreferrer"
              style={{ color: '#fff' }}
            >
              工序验收
            </a>
          </div>
          <Chart1 />

          <div
            className="side-panel2-subtitle"
            style={{ paddingLeft: 16, paddingTop: 24, paddingBottom: 16 }}
          >
            <a
              href={'http://wccg.tech:82/#/quality/wbsQualityExamineTotal' + searchStr}
              target="_blank"
              rel="noreferrer"
              style={{ color: '#fff' }}
            >
              质量问题
            </a>
          </div>
          <Chart2 />

          <div
            className="side-panel2-subtitle"
            style={{ paddingLeft: 16, paddingTop: 24, paddingBottom: 16 }}
          >
            <a
              href={'http://wccg.tech:82/#/safeScheme/wbsSafeExamineTotal' + searchStr}
              target="_blank"
              rel="noreferrer"
              style={{ color: '#fff' }}
            >
              安全问题
            </a>
          </div>
          <Chart3 />
        </div>
      </div>
    </div>
  );
};

export default Left;
